package com.ailink.design.pattern.observer.java;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by Administrator on 2018/8/14
 */
public class ConcreteObserver implements Observer {

    private String observerName;

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(observerName + " 推送 " + arg);
        System.out.println(observerName + " 拉取 " + ((ConcreteWeatherSubject)o).getContent());
    }

    public String getObserverName() {
        return observerName;
    }

    public void setObserverName(String observerName) {
        this.observerName = observerName;
    }
}
